1. Field of the Invention
The present general inventive concept relates to a method of prefetching data in a hard disk drive, and a recording medium and apparatus therefore, and more particularly, to a method of prefetching data in a hard disk drive using an advanced technology attachment (ATA) command about a non-volatile cache of an external apparatus, a recording medium having recorded thereon a program to execute the method, and an apparatus to perform the method.
2. Description of the Related Art
Since a flash memory does not contain parts that physically move, a flash memory has advantages of quick random read times and low power consumption. Using such advantages of a flash memory, a hybrid hard disk drive, which additionally includes a non-volatile cache formed of a flash memory along with a conventional hard disk, has been recently developed. The non-volatile cache performs a function of temporarily storing information about a logic block address (LBA) that is to be stored in a platter of the hard disk.
The hybrid hard disk drive has the following advantages compared to a conventional hard disk drive.
First, booting time of an operating system installed in the hybrid hard disk drive can be reduced. That is, the booting time can be reduced by copying files required for booting the operating system to the non-volatile cache, and using the files while booting the operating system. A conventional hard disk drive requires time to rotate a spindle motor up to a prescribed speed while resetting power of the operating system. However, since a host, which uses the hybrid hard disk, can read the files not from the hybrid hard disk but from the non-volatile cache, the booting time can be reduced.
Second, data access time can be reduced. That is, the host records data to be recorded both in the non-volatile cache and the hybrid hard disk. Accordingly, when data is read, the non-volatile cache is first searched for the data, and when the data is recorded, the data is read from the non-volatile cache. Considering that recently recorded data has high access possibility, the data access time can be reduced by using the non-volatile cache.
A method of prefetching data in a hard disk drive is a technology of pre-storing data, which is expected to be accessed in the near future, in a buffer and quickly processing a data access request. In a conventional hard disk drive, prefetching is performed by using only a spatial locality. A hard disk drive performs prefetching when a determination is made that a request of the host has a spatial locality. That is, the hard disk drive performs prefetching when data, which is requested to be read by the host, i.e. sectors have continuous logical block addresses (LBAs), and when a number of sectors is equal to or greater than a predetermined number. Data that is to be prefetched is also determined based on a spatial locality. That is, continuous pieces of data in the last LBA that is requested to be read by the host are read and stored in the buffer. An effect of prefetching is illustrated only when the host sequentially reads a massive amount of data, and prefetching cannot be performed when the host randomly accesses the hard disk drive.